<?php

/**
 * 打印管理
 * Created by PhpStorm.
 * User: 王琳
 * Date: 2015/12/17
 * Time: 4:31
 */
class StampAction extends Action{
//园级报告
    /*#园级报告  筛选#*/
    public function show_garden_screen_stamp(){
        //得到时间（年份）
        $years = D("Stamp")->get_year();
        $this->assign("years",$years);
        $this->display("garden_stamp_screen");
    }

    /*#园级报告  统计#*/
    public function show_garden_statistics_screen(){
        $number = D("Stamp")->get_portion_number();
        $num = $number[0]['portion_number'];
        $reports = D("Stamp")->get_stamp_data();//得到报告数据
        $this->assign("number",$num);//得到份数
        $this->assign("reports",$reports);
        $this->display("garden_stamp_statistics");
    }

    /*#打印管理 园级报告 统计 删除#*/

    public function delete_report(){
        $rpt_id = $_REQUEST['rpt_id'];
        $bool = D("Stamp")->delete_report_byID($rpt_id);
        switch($bool){
            case true:
                $this->show_garden_statistics_screen();
                break;
            case false:
                $this->error("删除失败");
                break;
        }
    }


}